<script setup>
	import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
	import { userStore } from "@/store/userStore";
	import { appStore } from "@/store/appStore";
	const user = userStore();
	const app = appStore();
	onLaunch(async (opt) => {
		console.log(opt.query)
		let query = opt.query??{}		//小程序链接参数
		let referee = query.referee??0		//推荐人
		const scene = decodeURIComponent(query.scene)		//小程序二维码参数
		if(typeof scene!='undefined'){
			let scene_arr = scene.split('=')
			if(scene_arr[0]=='pid' && scene_arr[1]>0){
				referee = scene_arr[1]
			}
		}
		console.log(referee)
		user.setReferee(referee)
		app.getSetting();
		await user.fetchUserInfo();
	});
	onShow(() => {});
	onHide(() => {});

	
</script>

<style lang="scss">
	/*每个页面公共css */
	@import '@/uni_modules/uni-scss/index.scss';
	/* #ifndef APP-NVUE */
	@import '@/static/customicons.css';
	@import './style/icons.css';
	
	// 设置整个项目的背景色
	page {
		background-color: #f5f5f5;
	}

	/* #endif */
	.example-info {
		font-size: 14px;
		color: #333;
		padding: 10px;
	}
	
	
	// 自定义导航栏样式颜色
	/* 自定义tabBar容器 */
	.uni-tabbar {
	  box-shadow: 0 -4rpx 20rpx rgba(108, 142, 125, 0.08) !important;
	  border-radius: 32rpx 32rpx 0 0 !important;
	  backdrop-filter: blur(10px); /* 毛玻璃效果 */
	}
	
	/* 图标动态效果 */
	.uni-tabbar__item.uni-tabbar__item--active .uni-tabbar__icon {
	  animation: iconFloat 1.2s ease-in-out infinite;
	}
	
	@keyframes iconFloat {
	  0%, 100% { transform: translateY(0); }
	  50% { transform: translateY(-10rpx); }
	}
	
	/* 文字标签样式 */
	.uni-tabbar__label {
	  font-family: "霞鹜文楷"; /* 推荐开源中文字体 */
	  font-weight: 300;
	  letter-spacing: 1rpx;
	  transform: scale(0.9);
	  transition: all 0.3s;
	}
	
	/* 激活状态文字效果 */
	.uni-tabbar__item--active .uni-tabbar__label {
	  text-shadow: 0 2rpx 4rpx rgba(108, 142, 125, 0.2);
	  transform: scale(1);
	}
</style>
